package main

import (
	"fmt"
	"strings"
)

func main() {
	fmt.Println("hello world!")
	const name = "haha"
	fmt.Println(name)

	fmt.Println(strings.Repeat("*", 20))
	const (
		A = 10
		B //default to last value
		C
		D
		E = 50
		F //default to last value
		G
	)
	fmt.Println(A)
	fmt.Println(B)
	fmt.Println(C)
	fmt.Println(D)
	fmt.Println(E)
	fmt.Println(F)
	fmt.Println(G)

	fmt.Println(strings.Repeat("*", 20))
	//iota
	const (
		Mon = iota
		Tue //default to iota
		Wed //default to iota
		Thu //default to iota - 有意思的是，iota就是从0开始，每次自增1
		Fri //default to iota
		Sat //default to iota
		Sun //default to iota
	)
	fmt.Println(Mon)
	fmt.Println(Tue)
	fmt.Println(Wed)
	fmt.Println(Thu)
	fmt.Println(Fri)
	fmt.Println(Sat)
	fmt.Println(Sun)

	//非()连续的const声明，从0开始
	const x = iota
	const y = iota
	fmt.Println(x) //0
	fmt.Println(y) //0

	fmt.Printf("%v\n", 0123)
	fmt.Printf("%v\n", 0x123)
	fmt.Printf("%v\n", 0b1100)

	fmt.Printf("%v\n", 2^3) //位运算，go不支持n次方的写法
	fmt.Printf("%#v\n", 1.67e5)
}
